package com.yh.csx.crm.service.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * SalesPermissionTree class
 *
 * @author huyalin
 * @date 2019/4/8
 */
@Data
public class SalesPermissionTree {

    @NotNull(message = "用户ID不能为空")
    @Min(value = 1000000000000L, message = "用户ID不正确")
    @ApiModelProperty("用户id")
    private Long userId;

    @NotBlank(message = "姓名不能为空")
    @ApiModelProperty("姓名")
    private String userName;

    @NotBlank(message = "手机号不能为空")
    @ApiModelProperty("手机号")
    private String phone;

    @NotBlank(message = "权限不能为空")
    @ApiModelProperty("权限")
    private String position;

    @NotNull(message = "父ID不能为空")
    @Min(value = 1000000000000L, message = "父ID不正确")
    @ApiModelProperty("父Id")
    private Long parentUserId;

    @ApiModelProperty("下属")
    private List<SalesPermissionTree> subsets = new ArrayList<>();
}
